home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 5 / Example 5.10 / heightMap.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-06-29  |  653 b   |  29 lines

  1. #ifndef _HEIGHTMAP_
  2. #define _HEIGHTMAP_
  3.  
  4. #include <d3dx9.h>
  5. #include "intpoint.h"
  6.  
  7. struct HEIGHTMAP
  8. {
  9.     //Functions
  10.     HEIGHTMAP(INTPOINT _size, float _maxHeight);
  11.     ~HEIGHTMAP();
  12.     void Release();
  13.     void operator*=(const HEIGHTMAP &rhs);
  14.  
  15.     HRESULT LoadFromFile(IDirect3DDevice9* Device, char fileName[]);
  16.     HRESULT CreateRandomHeightMap(int seed, float noiseSize, float persistence, int octaves);
  17.     void RaiseTerrain(RECT r, float f);
  18.     void SmoothTerrain();
  19.     void Cap(float capHeight);
  20.     float GetHeight(int x, int y);
  21.     float GetHeight(INTPOINT p);
  22.  
  23.     //variables
  24.     INTPOINT m_size;
  25.     float m_maxHeight;
  26.     float *m_pHeightMap;
  27. };
  28.  
  29. #endif